<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      div{
        width: 500px;
      }
    </style>
    <title></title>
  </head>
  <body>
    <div id="app">
      <!-- 对象绑定法 -->
      <div :style="obj">窗前明月光</div>
      <!-- 数组绑定法 -->
      <div :style="arr">疑是地上霜</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: "#app",
        data: {
          obj: {
            background: "gold",
            fontSize: "18px",
          },
          arr: [{ background: "blue" }, { fontSize: "18px" }],
        },
        methods: {},
      });
    </script>
  </body>
</html>
